#define _CRT_SECURE_NO_WARNINGS 1
#include "SList.h"
void test1()
{
	//int n = 0;
	//printf("输入链表长度\n");
	//scanf("%d", &n);
	//printf("依次打印每个链表的值\n");
	SLTNode* plist = NULL;
	//for (int i = 0; i < n; i++)
	//{
	//	int val = 0;
	//	scanf("%d", &val);
	//	SLTNode* newnode = BuyListNode(val);
	//	//头插
	//	newnode->next = plist;
	//	plist = newnode;
	//}
	SLTPushBack(&plist, 1000);
	SLTPushBack(&plist, 4);
	SLTPushBack(&plist, 5);
	SLTPushBack(&plist, 6);
	SLTPushBack(&plist, 7);

	SLTPushFront(&plist, 10);
	SLTPushFront(&plist, 20);
	SLTPushFront(&plist, 30);
	SLTPushFront(&plist, 40);
	Print(plist);

}
void test2()
{
	SLTNode* plist = NULL;
	//SLTPushBack(&plist, 1000);
	//SLTPushBack(&plist, 4);
	//SLTPushBack(&plist, 5);
	//SLTPushBack(&plist, 6);
	//SLTPushBack(&plist, 7);

	SLTPushFront(&plist, 10);
	SLTPushFront(&plist, 20);
	SLTPushFront(&plist, 30);
	SLTPushFront(&plist, 40);
	int n = SListFind(plist, 20);
	Print(plist);
	//SLTPopBack(&plist);
	//SLTPopBack(&plist);
	//SLTPopBack(&plist);
	//SLTPopFront(&plist);
	SLTPopFront(&plist);
	Print(plist);

}
test3()
{
	SLTNode* plist = NULL;
	SLTPushFront(&plist, 10);
	SLTPushFront(&plist, 20);
	SLTPushFront(&plist, 30);
	SLTPushFront(&plist, 40);
	SLTNode *pos= SListFind(plist, 20);
	//if (pos)
	//{
	//	pos->data*=10;
	//}
	//Print(plist);

	if (pos)
	{
		SLTInsert(&plist, pos, 10);
	}
	Print(plist);
}
int main()
{
	//test1();
	//test2();
	test3();
	return 0;
}